<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>MyConsole</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
    <link rel="stylesheet" href="../css/common.css">
    <script src="../layui/layui.js"></script>
    <script src="MyConsole.js" type="module"></script>
</head>
<body>
<div id="top_nav"></div>
<br/>
<div class="layui-container">
    <div style="overflow: hidden; height: 0">
        <div id="console"></div>
    </div>
    <button type="button" class="layui-btn" id="openWindow">打开Console</button>
</div>
<script src="../functions/addCommonHeader.js"></script>
<script>
    layui.use(["layer", "jquery"], function () {
        let layer = layui.layer;
        let $ = layui.jquery;
        let consoleWindow = null;
        $("#openWindow").on("click", function () {
            if (consoleWindow){
                layer.close(consoleWindow);
                consoleWindow = null;
            }
            else{
                consoleWindow = layer.open({
                    type: 1,
                    title: "Console",
                    shade: false,
                    resize: false,
                    content: $("#console"),
                    end: ()=>{
                        consoleWindow = null;
                    }
                })
            }
        })
    })
</script>
</body>
</html>